<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>团购王</title>
	<link rel="stylesheet" href="__PUBLIC__/bs/css/bootstrap.min.css">
	<link rel="stylesheet" href="../Public/css/index.css">
	<link rel="stylesheet" href="__PUBLIC__/Validform/style.css">
	<script src="__PUBLIC__/bs/js/jquery-1.7.2.min.js"></script>
	<script src="__PUBLIC__/bs/js/bootstrap.min.js"></script>
	<script src="__PUBLIC__/Validform/Validform_min.js"></script>
	<script src="../Public/js/index.js"></script>
	<script src="../Public/js/common.js"></script>

</head>
<body>
	<div class="container">
		<div class="header">
			<div class="logo"><img src="" alt=""></div>
			<div class="right">
			<div class="homemenu">
				<a href="">首页</a>
				<a href="">退出</a>
			</div>
			<div class="menuList">
				<a class="" href="javascript:void(0);">会员管理</a>
				
				<a class="Locality" href="<?php echo U('Locality/index');?>">地区管理</a>
				
				<a class="Category" href="<?php echo U('Category/index');?>">分类管理</a>
				
				<a class="" href="javascript:void(0);">商铺管理</a>
				
				<a class="" href="javascript:void(0);">商品管理</a>
				
				<a class="" href="javascript:void(0);">订单管理</a>
				
				<a class="Index" href="<?php echo U('Index/index');?>" style="background: #3B5A79;">站点概要</a>
			</div>

			</div>
		</div>
		<div class="box" >
			<div class="leftMenu">
				<div class="list-group ">
				  <a href="#" class="list-group-item active">
				    会员管理
				  </a>
				  <a href="#" class="list-group-item">查看会员</a>
				  <a href="#" class="list-group-item">添加会员</a>
				</div>
				<div class="list-group Locality">
				  <a href="#" class="list-group-item active">
				   地区管理
				  </a>
				  <a href="<?php echo U('Locality/index');?>" class="list-group-item">查看地区</a>
				  <a href="<?php echo U('Locality/add');?>" class="list-group-item">添加地区</a>
				</div>
				<div class="list-group Category">
				  <a href="#" class="list-group-item active">
				    分类管理
				  </a>
				  <a href="<?php echo U('Category/index');?>" class="list-group-item">查看分类</a>
				  <a href="<?php echo U('Category/add');?>" class="list-group-item">添加分类</a>
				</div>
				<div class="list-group ">
				  <a href="#" class="list-group-item active">
				   商铺管理
				  </a>
				  <a href="#" class="list-group-item">查看地区</a>
				  <a href="#" class="list-group-item">添加地区</a>
				</div>
				<div class="list-group ">
				  <a href="#" class="list-group-item active">
				   商品管理
				  </a>
				  <a href="#" class="list-group-item">查看地区</a>
				  <a href="#" class="list-group-item">添加地区</a>
				</div>
				<div class="list-group ">
				  <a href="#" class="list-group-item active">
				   订单管理
				  </a>
				  <a href="#" class="list-group-item">查看地区</a>
				  <a href="#" class="list-group-item">添加地区</a>
				</div>
				<div class="list-group Index">
				  <a href="#" class="list-group-item active" style="display: block;">
				   站点管理
				  </a>
				  <a href="#" class="list-group-item">查看地区</a>
				  <a href="#" class="list-group-item">添加地区</a>
				</div>
			</div>
			
<div class="rightBody">
	<span class='title'>编辑地区</span>
	<div id="content">
		<form  class='registerform' action="<?php echo U('Locality/edit_handle');?>" method="post">
		<table class='table table-striped table-bordered'>
			<thead>
				<tr>
					<th width="20%">名称</th>
					<th>值</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>所属地区</td>
					<td>
						<select name="pid" id="">
							<option value="0">顶级地区</option>
							<?php if(is_array($rows)): $i = 0; $__LIST__ = $rows;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$row): $mod = ($i % 2 );++$i; if($datarow['pid'] == $row['lid']): ?><option value="<?php echo ($row['lid']); ?>" selected>|<?php echo ($row['html']); echo ($row['lname']); ?></option>
							<?php else: ?>
								<option value="<?php echo ($row['lid']); ?>">|<?php echo ($row['html']); echo ($row['lname']); ?></option><?php endif; endforeach; endif; else: echo "" ;endif; ?>
						</select>
					</td>
				</tr>
				<tr>
					<td>地区名称</td>
					<td>
						<input type="text" name="lname" value="<?php echo ($datarow['lname']); ?>" datatype="*2-6" errormsg="长度2-6位任意字符"  nullmsg="地区名称不能为空" sucmsg="填写正确"/>
						<span class="Validform_checktip" >请输入2-6位任意字符</span>
					</td>
				</tr>
				
				<tr>
					<td>地区排序</td>
					<td>
						<input name="sort" value="<?php echo ($datarow['sort']); ?>" type="text" datatype="n1-100" nullmsg="排序不能为空"  errormsg="长度100个字符内" sucmsg="填写正确"/>
						<span class="Validform_checktip">必须为数字</span>
					</td>
				</tr>
				<tr>
					<td>是否显示</td>
					<td>
						<?php if($datarow['display'] == 0): ?><lable>
								<input type="radio" name="display"   value="1"/>	
								<span>显示</span>
							</lable>
							<lable>
								<input type="radio" name="display" checked value="0"/>	
								<span>隐藏</span>
							</lable>
						<?php else: ?>
							<lable>
								<input type="radio" name="display" checked   value="1"/>	
								<span>显示</span>
							</lable>
							<lable>
								<input type="radio" name="display"  value="0"/>	
								<span>隐藏</span>
							</lable><?php endif; ?>
					</td>
				</tr>
				<input type="hidden" name="lid" value="<?php echo ($datarow['lid']); ?>">
				<tr>
					<td></td>
					<td><input type="submit" class='btn btn-primary'  value="修改" /></td>
				</tr>
			</tbody>
		</table>
		</form>
	</div>
</div>

		</div>
	</div>
	<script type="text/javascript">

	$(function(){

		
		//Validform.js表单验证初始化
		$(".registerform").Validform({
				tiptype:3
		});

		// 根据模块名称使相应的顶部导航变色，左侧菜单列表显示
		cls="<?php echo get_url_module();?>";//获取模块名方法，Admin\common\common.php中自定义方法
		$(".menuList ."+cls).css('background','#3B5A79').siblings('a').css('background','#4081C1');
		$(".box .leftMenu ."+cls).show().siblings('div').hide();
		// alert(cls);
	})
	</script>
</body>	

</html>